package com.example.springbootclickhouse.controller;

import com.example.springbootclickhouse.common.entity.User;
import com.example.springbootclickhouse.dao.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wuxinxin
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserMapper userMapper;

    @GetMapping("/{userId}")
    public User getUser(@PathVariable Integer userId){
        User user = userMapper.selectById(userId);
        return user;
    }
}
